<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>值类型和引用类型 | JavaScript高级讲义</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../Sources/值类型和引用类型的特征.html" />
    
    
    <link rel="prev" href="../Sources/math.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="1.3"
        data-chapter-title="值类型和引用类型"
        data-filepath="Sources/值类型和引用类型.md"
        data-basepath=".."
        data-revision="Tue Oct 18 2016 20:46:48 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        JavaScript高级讲义
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.1" data-path="Sources/内容简介.html">
            
                
                    <a href="../Sources/内容简介.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>0.1.</b>
                        
                        内容简介
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1" >
            
            <span><b>1.</b> JavaScript基础知识复习</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="Sources/基础复习题.html">
            
                
                    <a href="../Sources/基础复习题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        基础复习题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
            <span><b>1.2.</b> 内置对象与方法</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="Sources/array.html">
            
                
                    <a href="../Sources/array.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.1.</b>
                        
                        Array
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="Sources/date.html">
            
                
                    <a href="../Sources/date.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.2.</b>
                        
                        Date
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="Sources/number.html">
            
                
                    <a href="../Sources/number.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.3.</b>
                        
                        Number
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="Sources/boolean.html">
            
                
                    <a href="../Sources/boolean.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.4.</b>
                        
                        Boolean
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="Sources/string.html">
            
                
                    <a href="../Sources/string.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.5.</b>
                        
                        String
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="Sources/math.html">
            
                
                    <a href="../Sources/math.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.6.</b>
                        
                        Math
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="Sources/值类型和引用类型.html">
            
                
                    <a href="../Sources/值类型和引用类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        值类型和引用类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="Sources/值类型和引用类型的特征.html">
            
                
                    <a href="../Sources/值类型和引用类型的特征.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        值类型和引用类型的特征
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="Sources/对象的动态特性.html">
            
                
                    <a href="../Sources/对象的动态特性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        对象的动态特性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="Sources/dom操作复习.html">
            
                
                    <a href="../Sources/dom操作复习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        DOM操作复习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="Sources/异常处理.html">
            
                
                    <a href="../Sources/异常处理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        异常处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="Sources/调试工具的使用.html">
            
                
                    <a href="../Sources/调试工具的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        调试工具的使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >JavaScript高级讲义</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x503C;&#x7C7B;&#x578B;&#x548C;&#x5F15;&#x7528;&#x7C7B;&#x578B;">&#x503C;&#x7C7B;&#x578B;&#x548C;&#x5F15;&#x7528;&#x7C7B;&#x578B;</h1>
<h2 id="1&#x503C;&#x7C7B;&#x578B;&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;">1.&#x503C;&#x7C7B;&#x578B;(&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;)</h2>
<ul>
<li><code>&#x6570;&#x503C;&#x7C7B;&#x578B;</code></li>
<li><code>&#x5E03;&#x5C14;&#x7C7B;&#x578B;</code></li>
<li><code>undefined</code></li>
<li><code>null</code></li>
<li><code>&#x5B57;&#x7B26;&#x4E32;</code></li>
</ul>
<p>&#x503C;&#x7C7B;&#x578B;&#x662F;&#x5B58;&#x50A8;&#x5728;&#x6808;&#xFF08;stack&#xFF09;&#x4E2D;&#x7684;&#x7B80;&#x5355;&#x6570;&#x636E;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;&#x5B83;&#x4EEC;&#x7684;&#x503C;&#x76F4;&#x63A5;&#x5B58;&#x50A8;&#x5728;&#x53D8;&#x91CF;&#x8BBF;&#x95EE;&#x7684;&#x4F4D;&#x7F6E;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> num = <span class="hljs-number">10</span>;
<span class="hljs-keyword">var</span> str = <span class="hljs-string">&quot;hello JS&quot;</span>;
<span class="hljs-keyword">var</span> flag = <span class="hljs-literal">true</span>;
<span class="hljs-keyword">var</span> un = <span class="hljs-literal">undefined</span>;
<span class="hljs-keyword">var</span> nu = <span class="hljs-literal">null</span>;
</code></pre>
<p><strong><em>&#x4E0A;&#x9762;&#x5B9A;&#x4E49;&#x7684;&#x8FD9;&#x4E9B;&#x503C;&#x7C7B;&#x578B;&#x7684;&#x6570;&#x636E;&#x5728;&#x5185;&#x5B58;&#x4E2D;&#x7684;&#x5B58;&#x50A8;&#x5982;&#x4E0B;</em></strong></p>
<p><img src="../Images/01-2.png" alt=""></p>
<h2 id="2&#x5F15;&#x7528;&#x7C7B;&#x578B;&#x590D;&#x5408;&#x6570;&#x636E;&#x7C7B;&#x578B;">2.&#x5F15;&#x7528;&#x7C7B;&#x578B;(&#x590D;&#x5408;&#x6570;&#x636E;&#x7C7B;&#x578B;)</h2>
<ul>
<li><code>&#x5BF9;&#x8C61;</code></li>
<li><code>&#x6570;&#x7EC4;</code></li>
<li><code>&#x51FD;&#x6570;</code></li>
</ul>
<p>&#x5B58;&#x50A8;&#x5728;&#x5806;&#xFF08;heap&#xFF09;&#x4E2D;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;&#x5B58;&#x50A8;&#x5728;&#x53D8;&#x91CF;&#x5904;&#x7684;&#x503C;&#x662F;&#x4E00;&#x4E2A;&#x6307;&#x9488;&#xFF08;point&#xFF09;&#xFF0C;&#x6307;&#x5411;&#x5B58;&#x50A8;&#x5BF9;&#x8C61;&#x7684;&#x5185;&#x5B58;&#x5904;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> arr = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>];
<span class="hljs-keyword">var</span> p1 = {name:<span class="hljs-string">&quot;&#x5F20;&#x4E09;&quot;</span>, age:<span class="hljs-number">18</span>};
<span class="hljs-keyword">var</span> p2 = {
    name:<span class="hljs-string">&quot;&#x674E;&#x56DB;&quot;</span>,
    age:<span class="hljs-number">50</span>,
    son:{
        name:<span class="hljs-string">&quot;&#x674E;&#x5C0F;&#x4E00;&quot;</span>,
        age:<span class="hljs-number">18</span>
    }
};

<span class="hljs-keyword">var</span> p3 = {
    name:<span class="hljs-string">&quot;&#x738B;&#x4E94;&quot;</span>,
    age:<span class="hljs-number">50</span>,
    children:[
        {
            name:<span class="hljs-string">&quot;&#x738B;&#x5C0F;&#x4E00;&quot;</span>,
            age:<span class="hljs-number">20</span>
        },
        {
            name:<span class="hljs-string">&quot;&#x738B;&#x5C0F;&#x4E8C;&quot;</span>,
            age:<span class="hljs-number">15</span>
        },
        {
            name:<span class="hljs-string">&quot;&#x738B;&#x5C0F;&#x4E09;&quot;</span>,
            age:<span class="hljs-number">12</span>
        }
    ]
}
</code></pre>
<p><strong><em>&#x4E0A;&#x9762;&#x5B9A;&#x4E49;&#x7684;&#x8FD9;&#x4E9B;&#x5F15;&#x7528;&#x7C7B;&#x578B;&#x7684;&#x6570;&#x636E;&#x5728;&#x5185;&#x5B58;&#x4E2D;&#x7684;&#x5B58;&#x50A8;&#x5982;&#x4E0B;</em></strong></p>
<p><img src="../Images/01-3.png" alt=""></p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../Sources/math.html" class="navigation navigation-prev " aria-label="Previous page: Math"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../Sources/值类型和引用类型的特征.html" class="navigation navigation-next " aria-label="Next page: 值类型和引用类型的特征"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
